

function calcsells_special_call_volcano()

    
    for i=1,table.getn(volcano_hole) do                           -- for all actors	  
        cell = volcano_hole[i]
    if empty_cell(cell) then 
        Attack.marktarget(cell)
    end 
  end
  
  return true
end




function goldchampion_digger()

	local target = Attack.get_target()
	Attack.aseq_rotate(0, target, "happy")
	local dmgt = Attack.aseq_time(0, "x")
	local power = tonumber(Attack.act_size(0))
	local health = tonumber(Attack.get_custom_param("health"))*tonumber(Attack.act_size(0))



        local intellectnum=tonumber(Game.MapLocDifficulty()/2)
              intellectnum = intellectnum + tonumber (Logic.hero_lu_item("intellect","count"))


	if target~=nil then

		local farest_dist, farest_enemy, ang_to_enemy = 0e0, nil, 0

		for k=1,Attack.act_count()-1 do

			if Attack.act_enemy(k) then
				local d = Attack.cell_dist(0,k)

				if d > farest_dist then farest_dist = d; farest_enemy = k; end
			end
		end



		if farest_enemy ~= nil then ang_to_enemy = Attack.angleto(target, farest_enemy) end
		local tower = Attack.atom_spawn(target, 0, "altar_volcano", ang_to_enemy)
		Attack.act_nodraw(tower, true)
		Attack.act_animate(tower, "appear", dmgt)
		Attack.act_nodraw(tower, false, dmgt)
		local edg = 1
		if Attack.act_belligerent(0) == 1 then edg = 0 end
		Attack.act_edge(tower , edg)

		----Attack.val_store(tower, "belligerent", Attack.act_belligerent(0))

		Attack.act_hp(tower, health)
		Attack.act_set_par(tower, "health",health)
		Attack.act_set_par(tower, "attack", math.floor(power*10))
		Attack.act_set_par(tower, "defense", math.floor(power*10))
		Attack.val_store(tower, "intellect",intellectnum)
		Attack.val_store(tower, "power", power)
		Attack.resort(tower)
		Attack.log(0.001,"add_blog_summon_magic_tower","targets",""..blog_side_unit(tower,0),"name",""..blog_side_unit(0,1))
	end

	return true

end


